package com.houseman.demo;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.houseman.workFlow.dto.WorkFlowInfo;
import com.houseman.workFlow.opening.WorkFlow;
import com.houseman.workFlow.opening.impl.WorkFlowImpl;

@SuppressWarnings("serial")
public class MyPageAction extends HttpServlet{

	@Override
	protected void service(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		
		WorkFlow ser = new WorkFlowImpl();
		
		String id = (String) req.getSession().getAttribute("userId");
		
		List<WorkFlowInfo> start = ser.queryStartByUserId(id);
		
		List<WorkFlowInfo> wait = ser.queryWaitingByUserId(id);
		
		req.setAttribute("start", start);
		req.setAttribute("wait", wait);
		
		req.getRequestDispatcher("/index.jsp").forward(req, resp);
 	}
}
